import { $get, $post, $delete, $patch } from './http'
const getProjetList = (params) => {
  return $get('/api/setting/projects', params)
}
const getSoftList = (params) => {
  return $get('/api/setting/softwares', params)
}

const addProjet = (data) => {
  return $post('/api/setting/projects', data)
}
const addSoft = (data) => {
  return $post('/api/setting/softwares', data)
}

const deleteProjet = (id) => {
  return $delete(`/api/setting/projects/${id}`)
}
const deleteSoft = (id) => {
  return $delete(`/api/setting/softwares/${id}`)
}

const modifyProject = (id, data) => {
  return $patch(`/api/setting/projects/${id}`, data)
}
const modifySoft = (id, data) => {
  return $patch(`/api/setting/softwares/${id}`, data)
}

const loginApply = (data) => {
  return $post('/api/user/login', data)
}
const loginQuit = (data) => {
  return $post('/api/user/quit', data)
}

const draggedProjet = (data) => {
  return $patch('/api/setting/projects/dragged', data)
}
const draggedSoft = (data) => {
  return $patch('/api/setting/softwares/dragged', data)
}

export default {
  getProjetList,
  getSoftList,
  addProjet,
  addSoft,
  deleteProjet,
  deleteSoft,
  modifyProject,
  modifySoft,
  loginApply,
  loginQuit,
  draggedProjet,
  draggedSoft
}
